# TODO
letters = 0
words = 1
sentences = 0

text = input("Text: ")
text_length = len(text)

for i in range(text_length):
    if(text[i].isalpha()):
        letters += 1

    if(text[i].isspace()):
        words += 1

    if(text[i] == "." or text[i] == "?" or text[i] == "!"):
        sentences += 1


L =  letters /  words * 100
S =  sentences /  words * 100
index = round(0.0588 * L - 0.296 * S - 15.8)

if index < 1:
    print("Before Grade 1")
elif index > 16:
    print("Grade 16+")
else:
    print(f"Grade {index}")


